/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 周斌
 * Date: 2023-12-12
 * Time: 8:48
 */
public class Exception {
    public static void main(String[] args) {
      int[] array = null;
        System.out.println(array.length);//空指针异常
        //Exception in thread "main" java.lang.NullPointerException
    }
    public static void main2(String[] args) {
        int[] array = {1,2,3};
        for(int i=0;i<=3;i++) {
            System.out.println(array[i]);//数组越界
            //Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 3
        }
    }
    public static void main1(String[] args) {
        System.out.println(10/0);//算术异常
        //Exception in thread "main" java.lang.ArithmeticException: / by zeroat Exception.main(Exception.java:10)
    }
}
